package com.sjgtw.cloud.system.api.service;

import com.sjgtw.cloud.common.core.constant.ServiceNameConstants;
import com.sjgtw.cloud.common.core.domain.R;
import com.sjgtw.cloud.system.api.fallbackfactory.RemoteUserFallbackFactory;
import com.sjgtw.cloud.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>Title: 用户信息数据API</p>
 * <p>Description: </p>
 * @author Admin
 * @date 2021-4-7
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
	
	/**
	 * <p>Title: 根据username获取用户信息 </p>
	 * <p>Description:</p>
	 * @param username 用户名
	 * @return
	 */
    @GetMapping(value = "/user/info/{username}")
    public R<LoginUser> getUserInfo(@PathVariable("username") String username);


	/**
	 * <p>Title: 根据userId获取用户信息 </p>
	 * <p>Description:</p>
	 * @param userId 用户名
	 * @return
	 */
	@GetMapping(value = "/user/user/{userId}")
	public R<LoginUser> getUser(@PathVariable("userId") Long userId);

    /**
     * <p>Title: 用户名密码超过次数 系统锁定用户</p>
     * <p>Description: </p>
     * @param userid  用户ID
     * @return
     */
    @PutMapping("/user/lockUserStatus")
    public R<Integer> lockUserStatus(@RequestParam("userid") Long userid);

}
